package com.java;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;

import com.java.common.boot.listener.ApplicationStartingEventListener;

/**
 * tomcat等web容器部署<br>
 * 代替web.xml<br>
 * 
 * @author Administrator
 * @date 2021年1月23日
 */
public class WebServletInitializer extends SpringBootServletInitializer {

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        SpringApplication app = application.application();
        app.addListeners(new ApplicationStartingEventListener());
        return application.sources(ApplicationServer.class);
    }

}